package com.ideal.lx_mss.mapper;

import com.ideal.lx_mss.dto.*;
import com.ideal.lx_mss.entity.CheckMssEntity;
import com.ideal.lx_mss.entity.MssDictEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

@Mapper
public interface BasicMapper {
    void truncateTables(@Param("tableName") String tableNames);

    /**
     * 合同采购结果信息表 contract_pur_result
     * @param entity
     * @param tableName
     */
    void insertContractPurResultTemp(@Param("entity") ContractPurResultDto entity, @Param("tableName") String tableName);

    /**
     * purchase_order_item–采购订单明细
     * @param purchaseOrderItemDto
     * @param purchase_order_item
     */
    void insertPurchaseOrderItem(@Param("entity")PurchaseOrderItemDto purchaseOrderItemDto, @Param("tableName") String purchase_order_item);

    /**
     * biz_code–业务编码的字典表，含多组业务编码，如工单类型、工单等级等
     * @param bizCodeDto
     * @param biz_code
     */
    void insertBizCodeDto(@Param("entity")BizCodeDto bizCodeDto, @Param("tableName")String biz_code);

    /**
     *  purchase_order–采购订单
     * @param purchaseOrderDto
     * @param purchase_order
     */
    void insertPurchaseOrderDto(@Param("entity")PurchaseOrderDto purchaseOrderDto, @Param("tableName")String purchase_order);

    /**
     *
     * @param materialDataDto
     * @param material_data
     */
    void insertMaterialDataDto(@Param("entity")MaterialDataDto materialDataDto, @Param("tableName")String material_data);

    /**
     *  frame_cont–框架协议表
     * @param frameContDto
     * @param frame_cont
     */
    void insertFrameContDto(@Param("entity")FrameContDto frameContDto, @Param("tableName")String frame_cont);

    /**
     * 对账单插入
     * @param entity
     */
    void insertMssCheck(@Param("entity")CheckMssEntity entity);

    /**
     * 字典插入
     * @param entity
     */
    void insertMssDict(@Param("entity")MssDictEntity entity);

    int insertTableUtilsMapper(@Param("sql")String sql);

    String[] getTableField(@Param("dbName")String dbName,@Param("tableName")String tableName);

    void insertTableNameTemp(@Param("tableNames") Set<String> tableNames,@Param("formId")String formId);

    Set<String> getTableNameTempSet(@Param("formId")String formId);

    int selectCount(@Param("tableName")String tableName);
}
